Message = new Class( {
	Implements : [ Events, Options ],

	options : {
		color : [ '#014F8A', '#FF6600', '#ff00ff', '#00ff00' ],
		defaultColor : '',
		target : null,
		period : 500,
		start : false,
		swf :null
	},

	initialize : function(options) {
		this.setOptions(options);

		this.count = 0;
		this.isStart = false;

		this.target = $(this.options['target']);

		if (this.options['start']) {
			this.start();
		}
	},

	start : function() {
		if(this._start){
			return;
		}else{
			this._start = true;
		}
		this.timer = this.changeMessageColor.periodical(this.options['period'], this);
	},

	changeMessageColor : function() {
		var color = this.options['color'][this.count++ % this.options['color'].length];

		this.target.style.color = color;

		this.isStart = true;
	},

	stop : function() {
		this.findSWF(this.options['swf']).stopSub();
		$clear(this.timer);
		this.target.style.color = this.options['defaultColor'];
		this.isStart = false;
	},

	startSub : function() {
		this.findSWF(this.options['swf']).startSub();
	},
	
	findSWF : function (movieName) {   
        if (navigator.appName.indexOf("Microsoft")!= -1) {   
            return window[movieName];   
        } else {   
        	alert(document[movieName]);
            return document[movieName];   
        }
    }
})